<?php

define('PRODUCTION_URL', 'novosti-futbola.ru');

if (!empty($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == PRODUCTION_URL) {
    define('IS_PRODUCTION', true);
} else {
    define('IS_PRODUCTION', false);
}

if (IS_PRODUCTION) {
    ini_set('display_errors', 0);
} else {
    ini_set('display_errors', 1);
}
error_reporting(E_ALL);

define('OLD_NEWS_DAYS', 120);
// TODO: если новость старая - надо кидать ее в архив

// include framework
require realpath(dirname(__FILE__)). '/framework/sysconfig.php';

// start application
define('APP_ROOT', realpath(dirname(__FILE__)));
define('SHARE_PATH', HOME_PATH . '/share');
define('APP_REGISTRY_PATH', 'file://' . SHARE_PATH . '/registry');
define('APP_REGISTRY_MODE_PATH', 'file://' . SHARE_PATH . '/registry/' . Env::server('HTTP_HOST', 'novosti-futbola.ru'));
define('APP_TEMPLATES_DIR', APP_ROOT . '/application.face/view');
Registry::set('View', new PlainPHPView(APP_TEMPLATES_DIR));
DbConnection::init(APP_REGISTRY_MODE_PATH . '/Database');

?>